<template>
    <!-- pages/meetingCreate/collectInfo/editSelectRange/editSelectRange.wxml -->
	<view>
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="content">修改字段</block>
		</cu-custom>
		<view>
		    <textarea placeholder="每行一个数据" :value="content" @input="inputChange"></textarea>
		    <button @tap="save" class="successbtn" type="default">完成</button>
		</view>
	</view>
</template>

<script>
// pages/meetingCreate/collectInfo/editSelectRange/editSelectRange.js
export default {
    data() {
        return {
            index: 0,
            content: ''
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad(options) {
        var index = options.index;
        var content = uni.getStorageSync('selectRange');
		this.index = index;
		this.content = content
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {},
    methods: {
        inputChange(e) {
			this.content = e.detail.value
        },

        save() {
            var that = this;
            var content = this.content;
            var arr = content.split('\n');
            console.log(arr);

            try {
                that.$api.prePage().updateSelectRange(that.index, arr);
                uni.navigateBack();
            } catch (e) {
                console.log(e);
            }
        }
    }
};
</script>
<style>
	page{
		background: #fff;
	}
/* pages/meetingCreate/collectInfo/editSelectRange/editSelectRange.wxss */
textarea {
    padding: 20rpx;
}
button[type='default'].successbtn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 88rpx;
    line-height: 88rpx;
    text-align: center;
    background-color: rgba(26, 117, 255, 1);
    color: #fff;
    width: 100%;
    border-radius: 0;
    padding: 0;
}
</style>
